<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
      
    </style>
</head>

<body>
    <div id="div">
        <!-- 实时响应:data中的状态有更新后，会重新渲染状态 -->
        <!-- 只能是data中状态会触发重新渲染，
            数据代理(3)/数据劫持(2): 
            data中的数据被vue增强
        -->
        

    </div>

    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>
        const msg2 =''
        const app = Vue.createApp({
            data: function () {
                return {
                    msg: 'hello vue',
                    msg1:''
                }
            },
            methods: {
                onInput(e) {
                    console.log(e);
                    this.msg = e.target.value;
                }
            },
        }).mount('#div');
    </script>

</body>

</html>